import { request } from '@/base/Request';
import { DeviceFault } from '@/base/model/DeviceFault';
import qs from 'qs';
import { Result } from '@/base/Result';
import { DeviceStatusVo } from '@/base/model/DeviceStatusVo';
import { DeviceFaultVo } from '@/base/model/DeviceFaultVo';

export function getDeviceFault(params: {
  pageIndex: number,
  pageSize: number,
  sortDirection: string,
  deviceId: number
}) {
  return request.getPage(DeviceFault, '/api/device-fault', { params });
}

export function getDeviceFaultNum(params: {
  deviceModelId?: number
}): Promise<Result<Array<DeviceFaultVo>>> {
  return request.getArray(DeviceFaultVo, '/api/device-fault/num', { params });
}
